import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:syn_4s/core/extension/build_context_extension.dart';
import 'package:syn_4s/core/extension/int_extension.dart';

class PermitToWorkItem extends StatelessWidget {
  final String iconSrc;
  final String title;

  const PermitToWorkItem(
      {super.key, required this.iconSrc, required this.title});

  @override
  Widget build(BuildContext context) {
      return Container(
        padding: EdgeInsets.symmetric(horizontal: 8.px),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.center,
        children: [
          Text(title,
              style: TextStyle(fontSize: 16.px, fontWeight: FontWeight.w900)),
          SizedBox(
            height: 6.px,
          ),
          SvgPicture.asset(
            alignment: Alignment.center,
            iconSrc,
            width: 48.px,
            height: 48.px,
          ),
          SizedBox(
            height: 6.px,
          ),
          Text("03-07-2024\n12:00:00",
              textAlign: TextAlign.center, style: TextStyle(fontSize: 14.px)),
          buildContent(context.l10n.pending_approval, 6),
          buildContent(context.l10n.approved, 10),
        ],
      ),
    );
  }

  Widget buildContent(String title, int num) {
    return Row(
      mainAxisAlignment: MainAxisAlignment.center,
      children: [
        Text(title, style: TextStyle(fontSize: 14.px)),
        SizedBox(width: 8.px),
        Text(
          num.toString(),
          style: TextStyle(fontSize: 22.px, fontWeight: FontWeight.w900),
        )
      ],
    );
  }
}
